Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inherit from dbt-sqlserver #32

Merged
merged 30 commits into from
Jan 14, 2021
Merged

Inherit from dbt-sqlserver #32

merged 30 commits into from
Jan 14, 2021

Conversation

jtcohen6
Copy link
Contributor

@jtcohen6 jtcohen6 commented Dec 15, 2020

untested code! just to give a sense of what this looks like

Based on / copied from:

  • dbt-postgresdbt-redshift inheritance (relevant files)
  • file diff between this repo and dbt-sqlserver
  • setup.py from dbt-spark for reporting version

SQL Strategies

If you need a Jinja adapter macro to do something genuinely different from the implementation in dbt-sqlserver, it's as simple as reimplementing it with a synapse__ prefix instead.

Today, if you want a macro to do exactly the same thing, you still need to reimplement it, but you can just wrap the sqlserver version:

{% macro synapse__get_columns_in_query(select_sql) %}
  {{ return(sqlserver__get_columns_in_query(select_sql)) }}
{% endmacro %}

There's a change I'd like to make for dispatched macros (dbt-labs/dbt-core#2923) which will enable you to completely avoid reimplementing macros if the synapse__ version is the same as the sqlserver__ version. (I currently have it under the v0.20.0 milestone.)

setup.py Outdated Show resolved Hide resolved
@mikaelene
Copy link
Contributor

I have now moved the repo to dbt-msft. So lets add the versions.py and try. Should we add dbt-sqlserver as a dependency in setup.py as well?

@dataders dataders marked this pull request as ready for review December 17, 2020 19:45
@mikaelene
Copy link
Contributor

This looks neat! Hope we can get this going. It would be much easier maintenance of both adapters.

@dataders
Copy link
Contributor

Agreed! This PR is top of my list

@dataders dataders mentioned this pull request Dec 27, 2020
@dataders dataders mentioned this pull request Jan 8, 2021
Copy link
Contributor

@dataders dataders left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jtcohen6 still a good chunk of work to be done here I think, but blocked in a weird way w/ the drop_relation() macro...

@dataders
Copy link
Contributor

dataders commented Jan 13, 2021

@jtcohen6 it's finally ready! thanks for holding my hand through this.
my only question is what version should this be? i just released v0.18.1. Maybe this PR and @mikaelene's dbt-msft/dbt-sqlserver#81 comprise v0.19.0?

@jtcohen6
Copy link
Contributor Author

@swanderz Amazing!!

That makes sense to me. We'll be releasing dbt v0.19.0-rc2 soon; you could test everything out, including this inheritance, by releasing dbt-sqlserver v0.19.0-rc2 + dbt-synapse v0.19.0-rc2 to follow. That way, if anything doesn't work as planned, there's still a chance to address before the final release.

@dataders dataders merged commit b6d2015 into master Jan 14, 2021
@sdebruyn sdebruyn deleted the inherit-from-sqlserver branch June 4, 2022 08:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants